//
//  CZXMPPManager.h
//  CZWeiXin
//
//  Created by Alvechen on 16/4/10.
//  Copyright © 2016年 alvechen. All rights reserved.
//

#import <Foundation/Foundation.h>

//主机名192.168.10.185、192.168.10.178
#define kCZ_HOST_NAME @"192.168.10.185"
//端口号 5222 8080
#define kCZ_HOST_PORT 5222
// 域 hongsui、im.zhigong.com
#define kCZ_DOMAIN @"im.zhigong.com"
// 资源
#define kCZ_RESOURCE @"职工e家"



//快速获取我的jid
#define kCZ_myJID [CZXMPPManager shareInstance].xmppStream.myJID

/************************ 模块 ***************************/
//心跳检测
#import <XMPPAutoPing.h>
//重连
#import <XMPPReconnect.h>
//花名册
#import <XMPPRoster.h>
#import <XMPPRosterCoreDataStorage.h>//花名册存储器
//聊天记录
#import <XMPPMessageArchiving.h>
#import <XMPPMessageArchivingCoreDataStorage.h>

//文件接收
#import "XMPPIncomingFileTransfer.h"
//文件发送
#import "XMPPOutgoingFileTransfer.h"

//头像模块
#import <XMPPvCardAvatarModule.h>
#import <XMPPvCardCoreDataStorage.h>
#import <XMPPvCardTemp.h>//在XMPPvCardTempModule中,@class XMPPvCardTemp;,实际使用要import

/***************************************************/

@class IMMessage;


@interface CZXMPPManager : NSObject

///XMPP(XML)流
@property (nonatomic,strong) XMPPStream  *xmppStream;
///心跳检测
@property (nonatomic,strong) XMPPAutoPing  *xmppAutoPing;
///重连
@property (nonatomic,strong) XMPPReconnect  *xmppReconnetc;
///花名册
@property (nonatomic,strong) XMPPRoster  *xmppRoster;
///聊天记录
@property (nonatomic,strong) XMPPMessageArchiving  *xmppMessageArchiving;
///文件接收
@property (nonatomic,strong) XMPPIncomingFileTransfer  *xmppIncomingFileTransfer;
///文件发送
@property (nonatomic,strong) XMPPOutgoingFileTransfer  *xmppOutgoingFileTransfer;
///个人资料头像模块
@property (nonatomic,strong) XMPPvCardAvatarModule  *xmppvCardAvatarModule;
///个人资料模板模块
@property (nonatomic,strong) XMPPvCardTempModule  *xmppvCardTempModule;

@property (nonatomic, assign) BOOL  xmppNeedRegister;



+ (instancetype)shareInstance;

/**
 * 登录
 */
- (void)loginWithAcountName:(NSString *)acountName password:(NSString *)password successHandle:(void(^)())successHandle errorHandle:(void(^)(NSError *error))errorHandle;

/// 注册
- (void)registerWithJID:(XMPPJID *)JID andPassword:(NSString *)password;

/**
 *  修改密码，前提是一定要保持登录状态
 */
- (void)changePasswordWith:(NSString *)username password:(NSString *)password;

/// 发送普通文本消息
- (void)sendTextMessage:(IMMessage *)message toJid:(XMPPJID *)jid;




@end





